import {ITopic, ITopicView, topic_original} from "../Topic";
import {h, reactive, ref, Ref, shallowReactive, toRef, ToRefs, toRefs,watchEffect, VNode} from "vue";
import {Tags_Data} from "../Tag";
import {题目类型} from "../题目类型";

export class 通用Topic implements ITopic<topic_original>{
	index : Ref<number> = ref(-1);
	topics_name : Ref<string> = ref("");
	resolve: Ref<string> = ref("");
	tag: Tags_Data = {
		TagNote : {
			text : ref(""),
			switch_editor : ref(false)
		},
		TagWrongCount : ref(0)
	};
	topic: topic_original = {
		topic_original:ref("")
	};
	type: Ref<题目类型> = ref(题目类型.None);
	
	/*readonly*/ self_new_view : ITopicView<topic_original>= 通用TopicView;
	
	constructor() {
	
	}
}


const 通用TopicView : ITopicView<topic_original> = {
	view(self:ITopic<topic_original>): VNode {
		return h('pre',self.topic.topic_original.value);
	}
}
